package cn.i7baozh.consumer.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * feign 拦截器
 * 阶段1：浏览器请求a组件
 * 阶段2：a组件访问b组件
 *
 * 拦截器作用在阶段2
 */
@Component
@Slf4j
public class TestRequestInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate template) {
        template.header("abc", "eee");
        log.info("TestRequestInterceptor ");
    }
}
